//
//  DYSetCollectionVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/21.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYSetCollectionVC.h"
#import "DYAddBranchShopCell.h"
#import "DYShopDecorateInputInfoCell.h"
#import "DYSetCollectionCell.h"
#import "DYSetCollectionFooterView.h"

@interface DYSetCollectionVC ()

@property (nonatomic,strong)NSArray *titleArray;
@property (nonatomic,strong)NSArray *palceholderArray;


@property (nonatomic,strong)DYSetCollectionFooterView *footerView;



@end

@implementation DYSetCollectionVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"收款设置";
}
-(void)dy_initData
{
    [super dy_initData];

    
    self.titleArray=@[@"店铺名称",@"店铺全称",@"行业",@"店铺地址",@"详细地址",@"营业执照",@"开户银行",@"开户卡号",@"开户户名",@"开户行全称",@"手机号",@"验证码",@"备注说明",@"审核状态"];
    self.palceholderArray=@[@"请输入店铺名称",@"请输入店铺全称",@"请选择行业",@"请选择店铺地址",@"请输入店铺详细地址",@"",@"请选择开户银行",@"请输入开户行卡号",@"请输入开户行行户名",@"请输入开户行全称",@"请输入手机号",@"请输入验证码",@""];
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.tableView.backgroundColor=WhiteColor;
    
    [self.tableView registerClass:[DYAddBranchShopCell class] forCellReuseIdentifier:@"DYAddBranchShopCell"];
    [self.tableView registerClass:[DYSetCollectionCell class] forCellReuseIdentifier:@"DYSetCollectionCell"];
    [self.tableView registerClass:[DYShopDecorateInputInfoCell class] forCellReuseIdentifier:@"DYShopDecorateInputInfoCell"];
    [self.tableView registerClass:[DYSetCollectionCodeCell class] forCellReuseIdentifier:@"DYSetCollectionCodeCell"];
    
    self.tableView.showsVerticalScrollIndicator=NO;
    self.tableView.tableFooterView=self.footerView;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 14;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==5) {
        return BILIHEIGHT(104);
    }else if (indexPath.row==12){
        return BILIHEIGHT(180);
    }
    return BILIHEIGHT(58);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    if (indexPath.row==5) {
        DYSetCollectionCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYSetCollectionCell" forIndexPath:indexPath];
        cell.titleLabel.text=self.titleArray[indexPath.row];
        return cell;
    }else if (indexPath.row==12){
        DYShopDecorateInputInfoCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopDecorateInputInfoCell" forIndexPath:indexPath];
        cell.titleLabel.text=self.titleArray[indexPath.row];
        cell.infoTextView.dy_placeHolder=@"";
        return cell;
    }else if (indexPath.row==11){
        DYSetCollectionCodeCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYSetCollectionCodeCell" forIndexPath:indexPath];
        return cell;
    }
    DYAddBranchShopCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYAddBranchShopCell" forIndexPath:indexPath];
    
    cell.titleLabel.text=self.titleArray[indexPath.row];
    cell.textField.placeholder=self.palceholderArray[indexPath.row];
    [cell.textField setValue:[UIColor xhq_assist] forKeyPath:@"_placeholderLabel.textColor"];
    if (indexPath.row==2||indexPath.row==3||indexPath.row==6||indexPath.row==13) {
        if (indexPath.row==13) {
            cell.textField.text=@"未审核";
          cell.arrowImageView.hidden=YES;
        }else{
          cell.arrowImageView.hidden=NO;
        }
        cell.textField.enabled=NO;
    }else{
        cell.arrowImageView.hidden=YES;
        cell.textField.enabled=YES;
        if (indexPath.row==7||indexPath.row==10) {
            [cell.textField setNumbersKeyboard];
        }
    }
    cell.textFieldBlock = ^(NSString *text) {
        NSLog(@"%@",text);
    };
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==2) {
        XHQHUDTEXT(@"选择行业");
    }
}
-(void)submitButtonClick
{
    
}
-(DYSetCollectionFooterView *)footerView
{
    if (!_footerView) {
        _footerView=[[DYSetCollectionFooterView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, BILIHEIGHT(150))];
    }
    return _footerView;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
